package dispatcher.group.gui.listener;

import java.awt.event.ActionEvent;
import java.net.InetAddress;

/**
 * This class encapsulate the event where GroupDispatcherStateHandler has fully been initialized and
 * the data from the GroupDispatcherStateHandler can be queried to connect to the
 * PersonDispatcher
 * @author Caleb
 *
 */
public class PersonDispatcherPreInitConditionEvent extends ActionEvent {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7133291697949656539L;

	private InetAddress address;
	private int port;
	
	/**
	 * The main constructor
	 * @param source The source of the event
	 * @param address The address of the PersonDispatcher
	 * @param port The port of the PersonDispatcher
	 */
	public PersonDispatcherPreInitConditionEvent(Object source, InetAddress address, int port) {
		super(source, 0, "");
		
		this.address = address;
		this.port = port;
	}

	/**
	 * This method returns the address of the PersonDispatcher
	 * @return Returns the address of the PersonDispatcher
	 */
	public InetAddress getAddress() {
		return address;
	}

	/**
	 * This method returns the port of the PersonDispatcher
	 * @return Returns the port of the PersonDispatcher
	 */
	public int getPort() {
		return port;
	}
}
